package com.yu.newsSys.listener;

import com.yu.newsSys.constants.ListenerConstants;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;
import java.util.ArrayList;
@WebListener
public class OnlineHttpServletContextListener implements ServletContextListener {
    @Override
    public void contextInitialized(ServletContextEvent sce) {
        ServletContext context = sce.getServletContext();
        ArrayList<String> onlineList = new ArrayList<>();
        context.setAttribute(ListenerConstants.ONLINE_LIST,onlineList);
    }
}
